<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>6. 参数拓展与收集</title>
</head>
<body>
<script>
  function foo(){
    let  sum = 0
      for (let i = 0; i < arguments.length; i++) {
          sum += arguments[i]
      }
      console.log(sum)
  }

  foo(1,2,3,4,5,6)
  let nums = [1,2,3]
  foo(nums)


</script>
</body>
</html>